#include <g3.h>

setcrtmode(CRTMODE)
unsigned int CRTMODE;
{
    switch(CRTMODE)
        {
    case TEXT80:   loclear();
    case TEXTMODE: /* unset double hires-lores */
		           poke(49247,0);
                   poke(49233,0);
                   PAGEONE;
                   if (CRTMODE == TEXTMODE)break;
                   crt80();
                   break;

    case DLORES:
				  /* set double lores */
				  poke(49246,0);

    case LORES:
                  poke(49238,0);   /* lo res */
                  PAGEONE;
                  poke(49232,0);   /* set graphics */
                  poke(49234,0);   /* full graphics */
                  loclear();
                  break;
    case DHRMODE:
                  /* set double hires */
		          poke(49246,0);

    case GRAFMODE:
    default  :
                  poke(49239,0);   /* hi res */
                  PAGEONE;
                  poke(49232,0);   /* set graphics */
                  poke(49234,0);   /* full graphics */

        }

}


